﻿Public Class f_productos
    Dim c As New Controlador
    Public alta_producto As Boolean = False
 
    Private Sub f_productos_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        c.muestra_productos()
        dg_productos.Columns(0).HeaderText = "Nombre"
        dg_productos.Columns(5).HeaderText = "Proveedor"
        dg_productos.Columns(4).HeaderText = "Categoría"
        
    End Sub

    Private Sub tb_b_nombre_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_b_nombre.TextChanged
        c.buscar_productos()
    End Sub

    Private Sub tb_b_categoria_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_b_categoria.TextChanged
        c.buscar_productos()
    End Sub

    Private Sub tb_b_proveedor_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tb_b_proveedor.TextChanged
        c.buscar_productos()
    End Sub

    Private Sub dg_productos_CellContentClick_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dg_productos.CellContentClick
        Me.alta_producto = False
    End Sub

    Private Sub b_guardar_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
        c.guardar_f_productos()
    End Sub
End Class